package com.greet.mapper;

import com.greet.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;

@Mapper
public interface UserMapper {
    @Select("select id, openid, name, phone, sex, id_number, avatar, create_time " +
            "from user where openid=#{openid}")
    User selectByOpenid(String openid);

    Long insert(User userQuery);

    @Select("select count(0) from user where create_time between #{begin} and #{end}")
    Integer countUser(LocalDateTime begin, LocalDateTime end);

}
